<template>
  <a-config-provider :locale="locale" :size="size" global update-at-scroll>
    <router-view />
    <global-setting />
  </a-config-provider>
</template>

<script lang="ts" setup>
import zhCN from "@arco-design/web-vue/es/locale/lang/zh-cn";
import useAppStore from "@/store/modules/app";
import useSettingsStore from "@/store/modules/settings";
import useColorTheme from "@/hooks/useColorTheme";

const appStore = useAppStore();
const settingsStore = useSettingsStore();
const { injectStyle, updateThemeColor } = useColorTheme();

const locale = computed(() => {
  return zhCN;
});
injectStyle(settingsStore.sideTheme);
updateThemeColor(settingsStore.theme);
const size = computed(() => appStore.size as any);
</script>
